
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
    
<?php


echo "<br>";
echo "<br>";

define('__ROOT__', dirname(dirname(__FILE__)));
$test1 = __ROOT__;


/** ------------------------------------------------------------------------------------------ */
/** INCLUDE                                                                                    */
/** ------------------------------------------------------------------------------------------ */
$path_global = $_SERVER["DOCUMENT_ROOT"]."/webmuebles/public/conf/globals.php";
//require_once ($path_global);
require_once ("D:\\Programs\\EasyPHP-DevServer-13.1VC9\\data\\localweb\\webmuebles\\public\\conf\\globals.php");

/** ------------------------------------------------------------------------------------------ */
/** LEER FICHERO DE PROPIEDADES                                                                */
/** ------------------------------------------------------------------------------------------ */
$pathfile = "D:\\Programs\\EasyPHP-DevServer-13.1VC9\\data\\localweb\\webmuebles\\public\\conf\\environment.properties"; //ConfigWM::path_file_env;
$matriz_conf = parse_ini_file($pathfile);
print_r($matriz_conf );

/** ------------------------------------------------------------------------------------------ */
/** ABRIR CONEXIÓN DB MYSQL */
/** ------------------------------------------------------------------------------------------ */
// Create connection
$con=mysqli_connect("localhost", "user_wmdb_innodb", "Temporal10", "wmdb_innodb", 3306);

// Check connection
if (mysqli_connect_errno($con))
{
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else {
	 echo "Conexión correcta<br>";
}

echo "CHARSET:" . $con->character_set_name();


/** ------------------------------------------------------------------------------------------ */
/** CAMBIAR ENCODING CONEXIÓN DB MYSQL */
/** ------------------------------------------------------------------------------------------ */
/* change character set to utf8 */
if (!$con->set_charset("utf8")) {
	printf("Error loading character set utf8: %s\n", $con->error);
} else {
	printf("<br>Current character set: %s\n", $con->character_set_name());
}

echo "<br>";
echo "<br>";
    

/** ------------------------------------------------------------------------------------------ */
/** SELECT DB */
/** ------------------------------------------------------------------------------------------ */
// Recuperar datos DB
$result = mysqli_query($con,"SELECT * FROM WM_C_DIR_PAIS");
echo "Test SELECT";
echo "<br>";
while($row = mysqli_fetch_array($result))
{
  echo $row['ID_PAIS'] . " - " . $row['CD_PAIS']. " - " . $row['DS_NOMBRE'];
  echo "<img src='/webmuebles/public/img/portal/ball_green_small.png'>";  
  echo "<br>";
}

/** ------------------------------------------------------------------------------------------ */
/** CERRAR CONEXIÓN DB MYSQL */
/** ------------------------------------------------------------------------------------------ */
// Cerrar conexión
mysqli_close($con);



echo "<br>FÍN<BR><BR>";

echo "Current date : ";
echo date("l F d, Y - h:i:s");
echo "<br><br>";
//phpinfo();		
?>

    </body>
</html>
